<template>
	<view>
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">发放详情</block>
		</cu-custom>
		<view class="list">
			<view class="left">物品名称</view>
			<view class="right">{{detail.goodsName}}</view>
		</view>
		<view class="list">
			<view class="left">物品来源</view>
			<view class="right">{{detail.goodsKindName}}</view>
		</view>
		<view class="list">
			<view class="left">发放时间</view>
			<view class="right">{{detail.sendTime}}</view>
		</view>
		<view class="list">
			<view class="left">发放人 </view>
			<view class="right">{{detail.sendEmployeeName}}</view>
		</view>
		<view class="list">
			<view class="left">领用人</view>
			<view class="right">{{detail.oldManNames}}</view>
		</view>
		<view class="image" v-if="detail.oldManUrlList&&detail.oldManUrlList.length>0">
			<view class="top">图片</view>
			<view class="bottom">
					<view class="bottom-inner">
						<image   v-for="(item,index) in detail.oldManUrlList" :key="index" :src="item" mode="" @click="preview(detail.oldManUrlList)"> </image>
					</view>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	// ### 发放详情 【传参:id(已发物品列表的id),返回:goodsName(物品名称),sendTime(发放时间),goodsKindName(物品来源),haveSendNum(发放数量),sendEmployeeName(发放人),oldManNames(领用人),oldManUrl(图片)】
	// GET {{baseUrl}}/{{warehouse-service}}/outSendLog/getById?id=202101030000001
	// Authorization: {{token}}
	export default {
		data() {
			return {
				detail:{}
			}
		},
		onLoad(options) {
			this.getById(options.id);
		},
		methods: {
			preview(image){
				 uni.previewImage({
				            urls: image,
					})
			},
			getById(id){
				let param = {}
				 param.id = id
				this.$http("/warehouse-service/outSendLog/getById", "get", param).then((res) => {
				    if (res.data.code == 200) {
						this.detail = res.data.data;
					}
				  }
				);
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import './details.scss';
</style>
